/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package pruebas;

import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.ProgressMonitor;

/**
 *
 * @author Elias Mendoza
 */
public class hilo extends Thread{
  ProgressMonitor pMonitor;
  
  public hilo(JPanelProgressBar panel){
    pMonitor = new ProgressMonitor(panel,"suma en progreso", "Nota",0, 100);
    pMonitor.setMillisToPopup( 0 );
    pMonitor.setMaximum(10);
    
  }
  
  public void run(){
    try {
      for(int i=1;i<=10;i++){
        sleep(500);
        pMonitor.setProgress(i);
        pMonitor.setNote(i+"%");
        System.out.println(i);
        if(pMonitor.isCanceled())
          break;
      }
      
    } catch (InterruptedException ex) {
      Logger.getLogger(hilo.class.getName()).log(Level.SEVERE, null, ex);
    }
    
  }
}
